package bg.btanev.eightyfour.shared.dto.person;

import bg.btanev.eightyfour.shared.dto.dtobase.DomainDtoValue;

/**
 * @author B.Tanev
 *
 */
public class ContactInfoDto implements DomainDtoValue {
	/**
	 *
	 */
	private static final long serialVersionUID = 2218537267747854438L;

	private String email;
	private String telephone;
	private String webSite;
	private AddressDto address;

	public ContactInfoDto() {
		super();
	}

	public ContactInfoDto(String email, String telephone, String webSite) {
		this(email, telephone, webSite, null);
	}

	public ContactInfoDto(String email, String telephone, String webSite, AddressDto address) {
		super();
		this.email = email;
		this.telephone = telephone;
		this.webSite = webSite;
		this.address = address;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getWebSite() {
		return webSite;
	}

	public void setWebSite(String webSite) {
		this.webSite = webSite;
	}

	public AddressDto getAddress() {
		return address;
	}

	public void setAddress(AddressDto address) {
		this.address = address;
	}

	@Override
	public String toString() {
		return "ContactInfoDto [address=" + address + ", email=" + email + ", telephone=" + telephone + ", webSite="
				+ webSite + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((address == null) ? 0 : address.hashCode());
		result = prime * result + ((email == null) ? 0 : email.hashCode());
		result = prime * result + ((telephone == null) ? 0 : telephone.hashCode());
		result = prime * result + ((webSite == null) ? 0 : webSite.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactInfoDto other = (ContactInfoDto) obj;
		if (address == null) {
			if (other.address != null)
				return false;
		} else if (!address.equals(other.address))
			return false;
		if (email == null) {
			if (other.email != null)
				return false;
		} else if (!email.equals(other.email))
			return false;
		if (telephone == null) {
			if (other.telephone != null)
				return false;
		} else if (!telephone.equals(other.telephone))
			return false;
		if (webSite == null) {
			if (other.webSite != null)
				return false;
		} else if (!webSite.equals(other.webSite))
			return false;
		return true;
	}
}
